/*
 * Logger.cpp
 *
 *  Created on: Apr 9, 2011
 *      Author: pablo
 */

#include "Logger.h"

#include <stdio.h>
#include <iostream>

using namespace std;



Logger::Logger(char* path) {
	this->debugWriter = new Writer(path);
}

Logger::~Logger() {
	delete this->debugWriter;
}

void Logger::log(string report){
	string reportLine;
	DateTime dateTime;

	reportLine.append(dateTime.now());
	reportLine.append("> ");
	reportLine.append(report);
	reportLine.append("\n");

	if (this->debugMode == true) {
		this->debugWriter->write("","",reportLine);
	}

}

void Logger::setDebugMode(bool debugMode){
	this->debugMode = debugMode;
}


